//
//  B_TextFiledButtonView.m
//  DreamOf
//
//  Created by 薛小刚 on 2018/8/30.
//  Copyright © 2018年 薛小刚. All rights reserved.
//

#import "B_TextFiledButtonView.h"

@implementation B_TextFiledButtonView
+ (instancetype) initB_TextFiledButtonView {
    B_TextFiledButtonView * alert = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
    [alert setView];
    return alert;
}

- (void) setView {
    
}

- (void) show {
    [[UIApplication sharedApplication].keyWindow addSubview:self];
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(KeyWindow.mas_top);
        make.left.equalTo(KeyWindow.mas_left);
        make.right.equalTo(KeyWindow.mas_right);
        make.bottom.equalTo(KeyWindow.mas_bottom);
    }];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self removeFromSuperview];
}

- (IBAction)B_buttonAction:(id)sender {
    [self removeFromSuperview];
    if (self.buttonAction) {
        self.buttonAction();
    }
}
@end
